package
{
	import flash.display.MovieClip;
	import flash.events.MouseEvent;
	
	import tools.ToolTip;
	import tools.tween.TweenMax;
	
	public class ManFront extends MovieClip
	{
		private var main:MovieClip;
		private var body:MovieClip;
		public var bodyArgs:Array;
		public var bodyNameArgs:Array;
		
		public function ManFront()
		{
			main = Resource.getMovieClip("mf");
			addChild(main);
			main.width = 229.35;
			main.height = 420.85;
			
			bodyArgs = [main.mf_head, main.mf_neck, main.mf_leftarm, main.mf_breast, main.mf_rightarm, main.mf_belly, main.mf_leg];
			bodyNameArgs = ["头部","脖子","左手","胸部","右手","腹部","腿部"];
			
			for (var j:int = 0; j < bodyArgs.length; j++) 
			{
				body = bodyArgs[j];
				ToolTip.BindDO(body,bodyNameArgs[j]);
				body.buttonMode = true;
				body.id = j;
				body.addEventListener(MouseEvent.MOUSE_OVER,overHandler);
				body.addEventListener(MouseEvent.MOUSE_OUT,outHandler);
			}
		}
		
		private function overHandler(e:MouseEvent):void
		{
			body = e.target as MovieClip;
			TweenMax.to(body, 1, {colorMatrixFilter:{colorize:0xDFBE7F}});
		}
		
		private function outHandler(e:MouseEvent):void
		{
			body = e.target as MovieClip;
			TweenMax.to(body, 1, {colorMatrixFilter:{}});
		}
	}
}